<!--$embed{"header.htm"}-->

<!--$if{ op=='edit' || op=='editpic'}-->
<h2 class="title"><img src="image/app/album.gif" />相册<!--$if{ album['albumname']}--> - ${album['albumname']}<!--$end--></h2>
<div class="tabs_header">
	<ul class="tabs">
		<li<!--$if{ op=='edit'}--> class="active"<!--$end-->><a href="cp.html?ac=album&op=edit&albumid=${albumid}"><span>编辑相册信息</span></a></li>
		<li<!--$if{ op=='editpic'}--> class="active"<!--$end-->><a href="cp.html?ac=album&op=editpic&albumid=${albumid}"><span>编辑图片</span></a></li>
		<li><a href="cp.html?ac=upload&albumid=${albumid}"><span>普通上传</span></a></li>
		<li><a href="cp.html?ac=upload&op=flash&albumid=${albumid}"><span>批量上传</span></a></li>
		<li><a href="cp.html?ac=upload&op=cam&albumid=${albumid}"><span>大头帖</span></a></li>
		<li><a href="space.html?uid=${space['uid']}&do=album&view=me"><span>返回我的相册</span></a></li>
	</ul>
</div>
<!--$end-->

<!--$if{ op == 'edit'}-->

<script type="text/javascript">
	function passwordShow(value) {
		if(value==4) {
			document.getElementById('span_password').style.display = '';
			document.getElementById('tb_selectgroup').style.display = 'none';
		} else if(value==2) {
			document.getElementById('span_password').style.display = 'none';
			document.getElementById('tb_selectgroup').style.display = '';
		} else {
			document.getElementById('span_password').style.display = 'none';
			document.getElementById('tb_selectgroup').style.display = 'none';
		}
	}
	function getgroup(gid) {
		if(gid) {
			var x = new Ajax();
			x.get('cp.html?ac=privacy&op=getgroup&gid='+gid, function(s){
				document.getElementById('target_names').innerHTML += s;
			});
		}
	}
</script>


<form method="post" id="theform" name="theform" action="cp.html?ac=album&op=edit&albumid=${albumid}" class="c_form">
<table cellspacing="0" cellpadding="0" class="formtable">
	<tr>
		<th width="80"><label for="albumname">相册名</label></th>
		<td><input type="text" id="albumname" name="albumname" value="${album['albumname']}" size="20" class="t_input" /></td>
	</tr>
	<tr>
		<th>隐私设置</th>
		<td>
			<select name="friend" onchange="passwordShow(this.value);">
				<option value="0"${friendarr[0]}>全站用户可见</option>
				<option value="1"${friendarr[1]}>全好友可见</option>
				<option value="2"${friendarr[2]}>仅指定的好友可见</option>
				<option value="3"${friendarr[3]}>仅自己可见</option>
				<option value="4"${friendarr[4]}>凭密码查看</option>
			</select>
			<span id="span_password" style="${passwordstyle}">密码:<input type="text" name="password" value="${album['password']}" size="10"></span>
		</td>
	</tr>
	<tbody id="tb_selectgroup" style="${selectgroupstyle}">
	<tr>
		<th>指定好友</th>
		<td><select name="selectgroup" onchange="getgroup(this.value);">
			<option value="">从好友组选择好友</option>
			<!--$for{value:groups}-->
			<option value="${for.index}">${value}</option>
			<!--$end-->
			</select> 多次选择会累加到下面的好友名单</td>
	</tr>
	<tr>
		<th>&nbsp;</th>
		<td>
		<textarea name="target_names" id="target_names" style="width:85%;" rows="3">${album['targetNames']}</textarea>
		<br>(可以填写多个好友名，请用空格进行分割)</td>
	</tr>
	</tbody>
	<tr>
		<th>&nbsp;</th>
		<td>
		<input type="hidden" name="refer" value="${_SGLOBAL['refer']}" />
		<input type="hidden" name="editsubmit" value="true" />
		<button name="submit" type="submit" class="submit" value="true">确定</button>&nbsp;
		</td>
	</tr>
	<tr>
		<th>&nbsp;</th>
		<td><a href="cp.html?ac=album&op=delete&albumid=${album['albumid']}" id="album_delete_${album['albumid']}" onclick="ajaxmenu(event, this.id, 99999)">删除相册</a></td>
	</tr>

</table>
<input type="hidden" name="formhash" value="<!--${&com.heaven.web.utils.Common.formhash()}-->" />
</form>


<!--$elseif{ op == 'editpic'}-->

<div class="notice">
提示：您可以指定一张图片作为当前相册的封面图片，但是，在下次上传新的图片后，系统会自动选择一张新图片来更新本相册的封面图片。
</div>

<!--$if{ list}-->
<div class="album_list">
	<form method="post" id="theform" name="theform" action="cp.html?ac=album&op=editpic&albumid=${albumid}">
	
	<table cellspacing="6" cellpadding="0">
		<!--$for{value:list}-->
		<tr>
			<td class="album">
				<input type="hidden" name="picid" value="${value['picid']}"/>
				<table cellspacing="0" cellpadding="0">
					<tr>
						<td width="20"><input type="checkbox" name="ids" value="${value['picid']}"></td>
						<td class="image">
							<a href="${value['bigpic']}" target="_blank"><img src="${value['pic']}" alt="" /></a>
							<!--$if{ album['albumname']}--><p style="text-align: center;"><a href="cp.html?ac=album&op=setpic&picid=${value['picid']}" id="a_picid_${value['picid']}" onclick="ajaxmenu(event, this.id, 2000)">设为封面</a></p><!--$end-->
						</td>
						<td>
							<textarea name="title${value['picid']}" rows="4" cols="70">${value['title']}</textarea>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<!--$end-->
		<tr>
			<td>
				<input type="checkbox" id="chkall" name="chkall" onclick="checkAll(this.form, 'ids')"><label for="chkall"> 全选</label>
				<input type="submit" name="editpicsubmit" value="更新说明" class="submit" onclick="this.form.action+='&subop=update';">
				<input type="submit" name="editpicsubmit" value="删除" class="submit" onclick="this.form.action+='&subop=delete';return ischeck('theform', 'ids')">
				<input type="submit" name="editpicsubmit" value="转移到:" class="submit" onclick="this.form.action+='&subop=move';return ischeck('theform', 'ids')">
				<select name="newalbumid">
				<!--$for{entry:albumlist} $set{value = entry.value} $set{key = entry.key}-->
				<!--$if{ albumid != value['albumid']}--><option value="${value['albumid']}">${value['albumname']}</option><!--$end-->
				<!--$end-->
				<!--$if{ albumid>0}--><option value="0">默认相册</option><!--$end-->
				</select>
			</td>
		</tr>
	</table>
	<input type="hidden" name="start" value="${start}" />
	<input type="hidden" name="editpicsubmit" value="true" />
	<input type="hidden" name="formhash" value="<!--${&com.heaven.web.utils.Common.formhash()}-->" />
	</form>
</div>
<div class="page">${multi}</div>
<!--$else-->
<div class="c_form">该相册下还没有图片。</div>
<!--$end-->


<!--$elseif{ op == 'delete'}-->

<div <!--$if{ !_SGLOBAL['inajax']}-->class="inpage"<!--$end-->>
<form method="post" id="theform" name="theform" action="cp.html?ac=album&op=delete&albumid=${albumid}">
	<h1>确定删除相册吗？</h1>
	<p class="btn_line">
		相册中的图片: 
		<select name="moveto">
			<option value="-1">彻底删除</option>
			<option value="0">转移到 默认相册</option>
			<!--$for{entry:albums}--> $set{value = entry.value}
				<!--$if{ value['albumid'] != albumid}-->
					<option value="${value['albumid']}">转移到 ${value['albumname']}</option>
				<!--$end-->
			<!--$end-->
		</select>
		<input type="hidden" name="refer" value="${_SGLOBAL['refer']}" />
		<input type="hidden" name="deletesubmit" value="true" />
		<button name="submit" type="submit" class="submit" value="true">确定</button>&nbsp;
		<!--$if{ _SGLOBAL['inajax']}--><button name="cancel" type="button" class="button" onclick="hideMenu()">取消</button><!--$end-->
	</p>
<input type="hidden" name="formhash" value="<!--${&com.heaven.web.utils.Common.formhash()}-->" />
</form>
</div>

<!--$end-->
<!--$embed{"footer.htm"}-->